<template>
  <div id="app">
    <div class="menu-class" >
      <el-menu
        :default-active="activeIndex"
        @select="handleSelect"
        class="el-menu-demo"
        mode="horizontal"
        background-color="#545c64"
        text-color="#fff"
        active-text-color="#ffd04b">

        <el-submenu index="1">
          <template slot="title">预测</template>
          <el-menu-item index="1-1">医疗数据预测</el-menu-item>
          <el-menu-item index="1-2">薪资数据预测</el-menu-item>
        </el-submenu>
        <el-menu-item index="2">模型训练</el-menu-item>
      </el-menu>
    </div>
    <br>
    <br>
    <div >
      <router-view></router-view>
    </div>


  </div>
</template>

<script>

export default {
  name: 'app',
  components: {},
  data () {
    return {
      testFormData:{
        name: ''
      },
      activeIndex: '1-1',



      // 表单数据
      formData: {
        gender: '',
        age: 18,
        hypertension: 2,
        heard_disease: 2,
        ever_married: '',
        work_type: '',
        Residence_type: '',
        avg_glucose_level: 0,
        bmi: 0,
        smoking_status: '',
        mode: ''
      },
      //预测结果
      res: 2,
      mode: '',
      fullscreenLoading: false,
      rules: {
        age: [
          { required: true, message: '年龄不能为空'},
          { type: 'number', message: '年龄必须为数字值'}
        ]
      }


    }
  },

  methods: {
    handleSelect(key, keyPath) {
      console.log(key)
      if (key === "1-1") {
        this.$router.push("/healthViews")
      }
      if (key === "1-2"){
        this.$router.push("/salaryViews")
      }
      if (key === "2"){
        this.$router.push("/modeTrain")
      }
    }
  }
}
</script>

<style scoped>
.form-container {
  display: flex;
  flex-wrap: wrap;
}

.el-row {
  width: 100%;
}

#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}


.el-row {
  margin-bottom: 20px;

  &:last-child {
    margin-bottom: 0;
  }
}

.el-col {
  border-radius: 4px;
}

.bg-purple-dark {
  background: #99a9bf;
}

.bg-purple {
  background: #d3dce6;
}

.bg-purple-light {
  background: #e5e9f2;
}

.grid-content {
  border-radius: 4px;
  min-height: 36px;
}

.row-bg {
  padding: 10px 0;
  background-color: #f9fafc;
}
.menu-class {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding-left: 0; /* 或者直接设置 padding: 0; */

}

</style>
